using CastleSample.Business.Interface;
using CastleSample.Entity;

namespace CastleSample.Business.Remoting.Server
{
    public class MembershipBizServiceProxy : BizServiceProxyBase<IMembershipBizService>, IMembershipBizService
    {
        public UserContext UserLogin(string userName, string password)
        {
            UserContext context = BizServiceLocal.UserLogin(userName, password);
            if (context != null)
            {
                context.OnlineMode = true;
            }
            return context;
        }

        public UserContext UserLogout(UserContext userContext)
        {
            BizServiceLocal.UserLogout(userContext);
            return userContext;
        }

        public bool IsUserTokenValid(UserContext userContext)
        {
            return BizServiceLocal.IsUserTokenValid(userContext);
        }
    }
}